<script setup lang='ts'>
import { ref } from 'vue';
import { useRouter } from "vue-router";
const router = useRouter()
const num = ref(6)

const item = setInterval(()=>{
    num.value--
    if(num.value === 0 ){
        clearInterval(item)
        router.push({name:'Task',query:{id:2}})
    }
},1000)
</script>

<template>
<div class="content1">
<h2>注册成功</h2>
<h4><span>{{num}}</span>秒后自动跳转到页面</h4>
</div>
</template>

<style scoped>
.content1{
    width: 600px;
    margin: auto;
    text-align: center;
    margin-top: 50px
}
h4{
    margin-top: 20px;
}
span{
    color: red;
}
</style>